Skip to content

Conversation

@sadasu
Copy link
Contributor

@sadasu sadasu commented Sep 23, 2025

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 23, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 23, 2025

@sadasu: This pull request references CORS-4157 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 23, 2025

Hello @sadasu! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 23, 2025
@sadasu sadasu force-pushed the aws-azure-gcp-dual-stack branch 5 times, most recently from bffb15b to 29d9d89 Compare September 24, 2025 04:29

// IPFamilyType represents the IP protocol family that cloud platform resources should use.
// +kubebuilder:validation:Enum=IPv4;DualIPv6Primary;DualIPv4Primary
// +kubebuilder:validation:XValidation:rule="self in ['IPv4', 'DualIPv6Primary', 'DualIPv4Primary']",message="ipFamily must be one of: IPv4, DualIPv6Primary, DualIPv4Primary"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enum should cover this, so I don't think we need this CEL too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, removed that.

// IPv4 indicates that cloud platform resources should use IPv4 addressing only.
IPv4 IPFamilyType = "IPv4"

// DualIPv6Primary indicates that cloud platform resources should use dual-stack networking with IPv6 as primary.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to call this DualStackIPv6Primary? I figure we often call it DualStack in other places so omitting Stack here might be confusing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to DualStackIPv*Primary

//
// +default="IPv4"
// +kubebuilder:default="IPv4"
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="ipFamily is immutable once set"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try this instead? I think this will be more robust

Suggested change
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="ipFamily is immutable once set"
// +kubebuilder:validation:XValidation:rule="!oldSelf.hasValue() || self == oldSelf",message="ipFamily is immutable once set",optionalOldSelf=true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried this make verify complains with:

error running generator schemacheck on group config.openshift.io: 
	could not run schemacheck generator for group/version config.openshift.io/v1: 
		MustNotExceedCostBudget: 
			^.properties[status].properties[platformStatus].properties[azure].properties[ipFamily]: Invalid value: {"Rule":"!oldSelf.hasValue() || self == oldSelf","Message":"ipFamily is immutable once set","MessageExpression":"","Reason":null,"FieldPath":"","OptionalOldSelf":true}: compilation failed: ERROR: <input>:1:29: found no matching overload for '_==_' applied to '(string, optional_type(string))'
 | !oldSelf.hasValue() || self == oldSelf
 | ............................^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, should be

Suggested change
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="ipFamily is immutable once set"
// +kubebuilder:validation:XValidation:rule="!oldSelf.hasValue() || self == oldSelf.value()",message="ipFamily is immutable once set",optionalOldSelf=true


// AWSPlatformSpec holds the desired state of the Amazon Web Services infrastructure provider.
// This only includes fields that can be modified in the cluster.
type AWSPlatformSpec struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a CEL rule here to prevent removing ipFamily if it exists

!has(oldSelf.ipFamily) || has(self.ipFamily)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it for Azure here, and found that make verify complained about this:

error running generator schemacheck on group config.openshift.io: 
	could not run schemacheck generator for group/version config.openshift.io/v1: 
		MustNotExceedCostBudget: 
			^.properties[status].properties[platformStatus].properties[azure]: Invalid value: {"Rule":"!has(oldSelf.ipFamily) \u0026\u0026 !has(self.ipFamily) || has(oldSelf.ipFamily) \u0026\u0026 has(self.ipFamliy)","Message":"ipFamily cannot be removed once set","MessageExpression":"","Reason":null,"FieldPath":"","OptionalOldSelf":null}: compilation failed: ERROR: <input>:1:78: undefined field 'ipFamliy'
 | !has(oldSelf.ipFamily) && !has(self.ipFamily) || has(oldSelf.ipFamily) && has(self.ipFamliy)
 | .............................................................................^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to use a feature gate aware XValidation rule

@sadasu sadasu force-pushed the aws-azure-gcp-dual-stack branch from 29d9d89 to 2c87771 Compare September 24, 2025 17:35
@sadasu sadasu force-pushed the aws-azure-gcp-dual-stack branch 2 times, most recently from a7b5164 to c0de8a0 Compare October 8, 2025 15:39
@sadasu sadasu force-pushed the aws-azure-gcp-dual-stack branch from c0de8a0 to 4ad5ded Compare October 14, 2025 16:07
- The new IPFamily can be set to IPv4, DualStackIPv6Primary or
DualStackIPv4Primary.
- This capability is currently behind feature gates
that were added earlier.
- ControllerConfig is also updated because it embeds the Infra
object.
- Added tests for this new field.
@sadasu sadasu force-pushed the aws-azure-gcp-dual-stack branch from 4ad5ded to fca93af Compare October 14, 2025 21:56
@sadasu
Copy link
Contributor Author

sadasu commented Oct 14, 2025

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 15, 2025

@sadasu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn fca93af link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jhixson74
Copy link
Member

/cc

@openshift-ci openshift-ci bot requested a review from jhixson74 October 15, 2025 20:38
// IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
// protocol family.
//
// +default="IPv4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me why we default this to IPv4? VS leaving it empty on upgrade?

Copy link
Contributor Author

@sadasu sadasu Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying assumption is that all existing running clusters are IPv4 based. If we leave the default as empty, after an upgrade, someone could actually set the value to DualStackIPv6Primary which is not supported. Setting it explicitly to IPv4 on an upgrade will protect us from this value being changed on upgraded clusters.

aws:
region: us-east-1
type: AWS
expectedStatusError: "status.platformStatus.aws.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, so is this the optionalOldSelf rule on the field itself triggering here? I guess it's the combination of that rule and the defaulting (which is a change of value)

@JoelSpeed
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 23, 2025
@openshift-ci-robot
Copy link

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-hypershift
/test e2e-aws-ovn-hypershift-conformance
/test e2e-aws-ovn-techpreview
/test e2e-aws-serial-1of2
/test e2e-aws-serial-2of2
/test e2e-aws-serial-techpreview-1of2
/test e2e-aws-serial-techpreview-2of2
/test e2e-azure
/test e2e-gcp
/test e2e-upgrade
/test e2e-upgrade-out-of-change

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 23, 2025
@sadasu
Copy link
Contributor Author

sadasu commented Oct 23, 2025

/verified by @sadasu

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Oct 23, 2025
@openshift-ci-robot
Copy link

@sadasu: This PR has been marked as verified by @sadasu.

In response to this:

/verified by @sadasu

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 8691c30 into openshift:master Oct 23, 2025
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants